package hr.to;

public class EmployeeTO {
	private String  employeeId;
	private String  employeeName;
	private String  email;
	private String  jobPosition;
	private long salary;
	private String departmentId;//insert, update, delete시 사용
	private DepartmentTO department;//select 결과 중 부서정보 담을 곳
	//생성자 : no-arg, 전체설정, departmentId(o) department(X) 생성자
	public EmployeeTO(){}
	public EmployeeTO(String employeeId, String employeeName, String email,
			String jobPosition, long salary, String departmentId,
			DepartmentTO department) {
		this.employeeId = employeeId;
		this.employeeName = employeeName;
		this.email = email;
		this.jobPosition = jobPosition;
		this.salary = salary;
		this.departmentId = departmentId;
		this.department = department;
	}
	public EmployeeTO(String employeeId, String employeeName, String email,
			String jobPosition, long salary, String departmentId) {
		this.employeeId = employeeId;
		this.employeeName = employeeName;
		this.email = email;
		this.jobPosition = jobPosition;
		this.salary = salary;
		this.departmentId = departmentId;
	}
	public String getEmployeeId() {
		return employeeId;
	}
	public void setEmployeeId(String employeeId) {
		this.employeeId = employeeId;
	}
	public String getEmployeeName() {
		return employeeName;
	}
	public void setEmployeeName(String employeeName) {
		this.employeeName = employeeName;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getJobPosition() {
		return jobPosition;
	}
	public void setJobPosition(String jobPosition) {
		this.jobPosition = jobPosition;
	}
	public long getSalary() {
		return salary;
	}
	public void setSalary(long salary) {
		this.salary = salary;
	}
	public String getDepartmentId() {
		return departmentId;
	}
	public void setDepartmentId(String departmentId) {
		this.departmentId = departmentId;
	}
	public DepartmentTO getDepartment() {
		return department;
	}
	public void setDepartment(DepartmentTO department) {
		this.department = department;
	}
	@Override
	public String toString() {
		return "EmployeeTO [employeeId=" + employeeId + ", employeeName="
				+ employeeName + ", email=" + email + ", jobPosition="
				+ jobPosition + ", salary=" + salary + ", departmentId="
				+ departmentId + ", department=" + department + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((department == null) ? 0 : department.hashCode());
		result = prime * result
				+ ((departmentId == null) ? 0 : departmentId.hashCode());
		result = prime * result + ((email == null) ? 0 : email.hashCode());
		result = prime * result
				+ ((employeeId == null) ? 0 : employeeId.hashCode());
		result = prime * result
				+ ((employeeName == null) ? 0 : employeeName.hashCode());
		result = prime * result
				+ ((jobPosition == null) ? 0 : jobPosition.hashCode());
		result = prime * result + (int) (salary ^ (salary >>> 32));
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		EmployeeTO other = (EmployeeTO) obj;
		if (department == null) {
			if (other.department != null)
				return false;
		} else if (!department.equals(other.department))
			return false;
		if (departmentId == null) {
			if (other.departmentId != null)
				return false;
		} else if (!departmentId.equals(other.departmentId))
			return false;
		if (email == null) {
			if (other.email != null)
				return false;
		} else if (!email.equals(other.email))
			return false;
		if (employeeId == null) {
			if (other.employeeId != null)
				return false;
		} else if (!employeeId.equals(other.employeeId))
			return false;
		if (employeeName == null) {
			if (other.employeeName != null)
				return false;
		} else if (!employeeName.equals(other.employeeName))
			return false;
		if (jobPosition == null) {
			if (other.jobPosition != null)
				return false;
		} else if (!jobPosition.equals(other.jobPosition))
			return false;
		if (salary != other.salary)
			return false;
		return true;
	}
	
}
